package com.qf.controller;

import com.qf.pojo.User;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lixu
 */
@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired //Spring的全家桶
    private UserService userService;
    @Autowired //1：将进行类型注入 2：通过ID注入
    private User user11;//2022


    @GetMapping("/list")
    public String list(String name){
        userService.find();
        //不写也有默认的application.properites 默认是8080端口
        System.out.println("user:id:" + user11.getId());
        System.out.println("user:name:" + user11.getName());
        return "SpringBoot:" + name;
    }


}
